@model VotingSystem.ViewModels.LoginViewModel

@{
    ViewData["Title"] = "登录";
}

<div class="row justify-content-center">
    <div class="col-md-6">
        <div class="card shadow-sm">
            <div class="card-body">
                <h2 class="card-title text-center mb-4">
                    <i class="fas fa-sign-in-alt"></i> @ViewData["Title"]
                </h2>
                <form asp-action="Login" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post">
                    <div asp-validation-summary="ModelOnly" class="text-danger"></div>
                    
                    <div class="mb-3">
                        <label asp-for="UserName" class="form-label"></label>
                        <div class="input-group">
                            <span class="input-group-text"><i class="fas fa-user"></i></span>
                            <input asp-for="UserName" class="form-control" placeholder="请输入用户名" />
                        </div>
                        <span asp-validation-for="UserName" class="text-danger"></span>
                    </div>

                    <div class="mb-3">
                        <label asp-for="Password" class="form-label"></label>
                        <div class="input-group">
                            <span class="input-group-text"><i class="fas fa-lock"></i></span>
                            <input asp-for="Password" class="form-control" placeholder="请输入密码" />
                        </div>
                        <span asp-validation-for="Password" class="text-danger"></span>
                    </div>

                    <div class="mb-3 form-check">
                        <input asp-for="RememberMe" class="form-check-input" />
                        <label asp-for="RememberMe" class="form-check-label"></label>
                    </div>

                    <div class="d-grid gap-2">
                        <button type="submit" class="btn btn-primary">
                            <i class="fas fa-sign-in-alt"></i> 登录
                        </button>
                    </div>
                </form>

                <div class="mt-3 text-center">
                    <p>
                        还没有账号？ <a asp-action="Register" class="text-decoration-none">立即注册</a>
                    </p>
                </div>
            </div>
        </div>
    </div>
</div>

@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
} 